<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
        <tr>
            <th class="text-center">
                <div>ID</div>
            </th>
            <th class="text-center" width="20%">模块名称</th>
            <th class="text-center" width="19%">专业/科目</th>
            <th class="text-center" width="6%">模块类型</th>
            <th class="text-center" width="6%">预估素材数</th>
            <th class="text-center" width="11%">创建人</th>
            <th class="text-center" width="11%">完成状态</th>
            <th class="text-center" width="11%">状态</th>
            <th class="text-center" width="11%">操作</th>
        </tr>
        </thead>
    </table>
    <div class="J_V_tabContent table-xScrollWrap">
        <table class="table table-bordered table-hover table-xs-content">
            <tbody id="tbodyMaterial">
            <tr class="jqgfirstrow" role="row">
                <th class="text-center">
                    <div></div>
                </th>
                <th class="text-center" width="20%"></th>
                <th class="text-center" width="19%"></th>
                <th class="text-center" width="6%"></th>
                <th class="text-center" width="6%"></th>
                <th class="text-center" width="11%"></th>
                <th class="text-center" width="11%"></th>
                <th class="text-center" width="11%"></th>
                <th class="text-center" width="11%"></th>
            </tr>
            <tr th:if="${#lists.isEmpty(dataMap['list'])}">
                <td colspan="9" class="text-center">
                    <div class="noDataTipsBox">
                        <p><span class="c-4e fs16">亲，还没有数据~~~</span></p>
                    </div>
                </td>
            </tr>
            <tr th:if="!${#lists.isEmpty(dataMap['list'])}" th:each="mould : ${dataMap['list']}" th:attr="id='mould-'+${mould['id']}">
                <td class="text-center">
                    <input type="checkbox" class="i-checks" th:value="${mould['id']}">
                </td>
                <td class="text-center" th:text="${mould['mouldName']}"></td>
                <td class="text-center">
                    <th:block th:if="!${#lists.isEmpty(mould['subjectList'])}">
                        <span class="pie" th:each="subject,subIndex : ${mould['subjectList']}">
                            <th:block th:text="${subject['subjectName']}+'/'"></th:block>
                            <th:block th:if="!${#lists.isEmpty(subject['childSubjectList'])}" th:each="child,index : ${subject['childSubjectList']}">
                                <th:block th:if="${index.last} == false" th:text="${child['subjectName']}+'/'"></th:block>
                                <th:block th:if="${index.last} == true" th:text="${child['subjectName']}"></th:block>
                            </th:block>
                            <th:block th:if="${#lists.isEmpty(subject['childSubjectList'])}">全部科目</th:block>
                            <th:block th:if="${subIndex.last}==false" th:utext="'<br/>'"></th:block>
                        </span>
                    </th:block>
                    <th:block th:if="${#lists.isEmpty(mould['subjectList'])}">
                        <span class="pie">—</span>
                    </th:block>
                </td>
                <td class="text-center">
                    <samp th:if="${mould['mouldType']}==1">公共模块</samp>
                    <samp th:if="${mould['mouldType']}==2">私有模块</samp>
                </td>
                <td class="text-center" th:text="${mould['materialNum']}"></td>
                <td class="text-center" th:text="${#maps.isEmpty(mould['createUser'])}?'—':${mould['createUser']['ralName']}"></td>
                <td class="text-center" th:attr="id='finish-status-'+${mould['id']}">
                    <span th:if="${mould['finish']}==1" class="label label-default">未完成</span>
                    <span th:if="${mould['finish']}==2" class="label label-info">已完成</span>
                </td>
                <td class="text-center" th:attr="id='status-'+${mould['id']},data-status=${mould['status']}">
                    <span th:if="${mould['status']}==1" class="label label-default">未发布</span>
                    <span th:if="${mould['status']}==2" class="label label-info">已发布</span>
                    <span th:if="${mould['status']}==3" class="label label-danger">已隐藏</span>
                </td>
                <td class="text-center">
                    <a th:attr="data-id=${mould['id']}" href="javascript:void(0)" class="c-master fs14" data-toggle="tooltip" data-placement="bottom" data-original-title="查看"><i class="fa fa-eye"></i></a>
                    <a th:href="@{/admin/course/mould/initUpdate?id={id}(id=${mould['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="编辑"><i class="fa fa-edit"></i></a>
                    <a th:href="@{/admin/course/mould/initMouldMaterialData?mouldId={mouldId}(mouldId=${mould['id']})}" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="章节"><i class="fa fa-list"></i></a>
                    <a th:attr="data-id=${mould['id']},id='finish-action-'+${mould['id']}" th:if="${mould['finish']}==1" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="完成"><i class="fa fa-gavel"></i></a>
                    <a th:attr="data-id=${mould['id']},data-status=${mould['status']},id='status-action-'+${mould['id']}" th:if="${mould['status']}==1" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="发布"><i class="fa fa-arrow-up"></i></a>
                    <a th:attr="data-id=${mould['id']},data-status=${mould['status']},id='status-action-'+${mould['id']}" th:if="${mould['status']}==3" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="恢复"><i class="fa fa-history"></i></a>
                    <a th:attr="data-id=${mould['id']},data-status=${mould['status']},id='status-action-'+${mould['id']}" th:if="${mould['status']}==2" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="隐藏"><i class="fa fa-ban"></i></a>
                    <a th:attr="data-id=${mould['id']},data-status=${mould['status']}" href="javascript:void(0);" class="c-master fs14 ml5" data-toggle="tooltip" data-placement="bottom" data-original-title="删除"><i class="fa fa-trash"></i></a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <!-- 分页，开始 -->
    <div data-th-replace="layout/adminPage"></div>
    <!-- 分页，结束 -->
</div>
</html>